<?php
namespace C\lib {
    class Sms {



        public static function send($msg, $mb, $user = NULL, $pwd = NULL, $serv = NULL) {
            $user = '132';
            $pwd = '196157';

            if(is_array($mb)) $mb = implode(',', $mb);
            $time = date('YmdHis');
            $pw = md5($pwd . $time);
            $Mb = $mb;
            $ms = $msg;
            $tm = $time;
            $ex =01;

            $strParam = "uid=" . $user . "&pw=" . $pw . "&mb=" . $Mb . "&ms=" . $ms . "&ex=" . $ex. "&tm=" . $tm. "&dm= ";
            $strUrl = "http://s.qingmu.mobi:18002/send.do";
            $ch = curl_init($strUrl."?".$strParam);

            curl_setopt($ch,CURLOPT_RETURNTRANSFER, true);
            curl_setopt($ch, CURLOPT_BINARYTRANSFER, true) ;
            curl_setopt($ch, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_0);
            $output = curl_exec($ch);
            $ra = explode(',', $output);
            if($ra[0] == '0') {
                return true;
            } else {
                return false;
            }
        }
    }
}

